# -*- coding: utf-8 -*-
# @Time    : 2021/1/1 下午4:13
# @Author  : tgy


def test01():
    """
    str -> bytes == unicode -> 其他编码
    bytes -> str == 其他编码 -> unicode
    """
    print(b'\xe4\xb8\xad\xe6\x96\x87'.decode('utf-8'))
    # encode: unicode -> 其他编码
    # decode: 其他编码 -> unicode
    # bytes 表示encode之后的byte
    print(bytes('张三', encoding='utf-8'))

    gbk_encode = '上'.encode('gbk')
    print(gbk_encode)
    utf_8_encode = '上'.encode('utf-8')
    print(utf_8_encode)
    score = 19.1112
    print(f'score = {score:.2f}')


if __name__ == '__main__':
    ...
    test01()
